#include <stdio.h>

int main(int argc, char *argv[]) {
    int size = 0;
    scanf("%d", &size);
    size = size + 1;
    
    int nums[size];
    for (size_t i = 1; i < size; i++)
    {
        scanf("%d", &nums[i]);
    }

    for (size_t i = 1; i < sizeof(nums)/sizeof(nums[0]); i++)
    {   
        for (size_t n = 1; n <= nums[i]; n++)
        {
            for (size_t z = n; z <= 9; z++)
            {
                printf("%d*%d=%d ", n, z, n * z);
            }
            printf("\n");
        }

        printf("\n");
    }
    
    

    return 0;
}